package com.ciba.demo.util;

import java.util.Random;
import java.util.regex.Pattern;

public class KeyUtils {
    public static String getKey() {
        String str="0123456789";
        StringBuilder st=new StringBuilder(4);
        for(int i=0;i<4;i++){
            char ch=str.charAt(new Random().nextInt(str.length()));
            st.append(ch);
        }
        String findkey=st.toString().toLowerCase();
        System.out.println("生成的验证码："+findkey);
        return findkey;
    }
}
